package com.consumer;

import java.util.Random;

public class ProductionCompuder implements Runnable
{
	
	private Buffer buffer;
	
	
	public ProductionCompuder(Buffer buffer){
		this.buffer = buffer;
	}
	
	@Override
	public void run()
	{
		for(int i = 0 ;i<=500;i++){
			//生产电脑
			Computer computer = new Computer(i);
			//入库
			buffer.croduction(computer);
			
			System.out.println("生产 "+computer);
			try
			{
				Thread.sleep(new Random().nextInt(10)*100);
			} catch (InterruptedException e)
			{
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
}
